@extends('layout.home')
@section('title','个人中心')
@section('content')	
  <div class="aw-container-wrap"> 
   <div class="container"> 
    <div class="row"> 
     <div class="aw-content-wrap clearfix"> 
      <div class="col-sm-12 col-md-9 aw-main-content"> 
       <!-- 用户数据内容 --> 
       <div class="aw-mod aw-user-detail-box"> 
        <div class="mod-head uc_top_bg"> 
         <img class="avatar-img img-circle" src="{{$user->profile}}" alt="admin" /> 
         <?php
          if($id == session('id')){
            echo '
         <span class="pull-right operate"> <a href="/user/centeredit?id='.$user->id.'" class="btn btn-mini btn-success">编辑</a> </span> ';
       }
         ?>
         <h1 style="color:#fff;">{{$user->username}}</h1> 
         <p class="text-color-000"></p> 
         <p class="aw-user-flag"> </p> 
        </div> 
        <div class="mod-body"> 
         <div class="meta"> 
          <span><i class="icon icon-prestige"></i> 威望 : <em class="aw-text-color-green">0</em></span> 
          <span><i class="icon icon-agree"></i> 赞同 : <em class="aw-text-color-orange">0</em></span> 
          <span><i class="icon icon-thank"></i> 关注 : <em class="aw-text-color-orange">0</em></span> 
         </div> 
        </div> 
        <div class="mod-footer"> 
         <ul class="nav nav-tabs aw-nav-tabs"> 
          <li class="active"><a href="#overview" id="page_overview" data-toggle="tab">概述</a></li> 
          <li><a href="#answers" id="page_answers" data-toggle="tab">回复<span class="badge">{{count($replys)}}</span></a></li> 
          <li><a href="#questions" id="page_questions" data-toggle="tab">发问<span class="badge">{{count($cards)}}</span></a></li> 
          <li><a href="#focus" id="page_focus" data-toggle="tab">关注</a></li>  
         </ul> 
        </div> 
       </div> 
       <!-- end 用户数据内容 --> 
       <div class="aw-user-center-tab"> 
        <div class="tab-content"> 
         <div class="tab-pane active" id="overview"> 
          <!-- 回复 --> 
          <div class="aw-mod">
            <div class="mod-head"> 
              <h3><a class="pull-right aw-more-content" href="javascript:;" onclick="$('#page_answers').click();">更多 &raquo;</a>回复</h3> 
            </div> 
            <div class="mod-body"> 
              <div class="aw-profile-answer-list"> 
              @if(count($replys))
                <div class="aw-item"> 
                  <div class="mod-head"> 
                    <h4><a href="/question/qdetail?id={{$replys[0]->tid}}">{{$title}}</a></h4> 
                  </div> 
                  <div class="mod-body"> 
                    <span class="aw-border-radius-5 count pull-left"><i class="icon icon-agree"></i>0</span> 
                    <p class="aw-hide-txt">{{$replys[0]->contents}}</p> 
                  </div> 
                </div> 
                @else
                <p class="padding10 text-center">没有内容</p>
                @endif
              </div> 
            </div>
          </div> 
          <!-- end 回复 --> 
          <!-- 发问 --> 
          <div class="aw-mod">
            <div class="mod-head"> 
              <h3><a class="pull-right aw-more-content" href="javascript:;" onclick="$('#page_questions').click();">更多 &raquo;</a>发问</h3> 
            </div> 
            <div class="mod-body"> 
              <div class="aw-profile-publish-list"> 
              @if(count($cards))
                <div class="aw-item"> 
                  <div class="mod-head"> 
                    <h4><a href="/question/qdetail?id={{$cards[0]->id}}">{{$cards[0]->title}}</a></h4> 
                  </div> 
                  <div class="mod-body"> 
                    <span class="aw-border-radius-5 count pull-left"><i class="icon icon-reply"></i>{{$cards[0]->count}}</span> 
                    <p class="aw-hide-txt">4 次浏览 &nbsp;• 1 个关注 &nbsp; • {{$cards[0]->time}}</p> 
                  </div> 
                </div>
                 @else
                 <p class="padding10 text-center">没有内容</p>
                  @endif       
              </div> 
            </div> 
          </div> 
          <!-- end 发问 --> 
          <!-- 最新动态 --> 
          <div class="aw-mod"> 
           <div class="mod-head"> 
            <h3><a class="pull-right aw-more-content" href="javascript:;" onclick="$('#page_actions').click();">更多 &raquo;</a>动态</h3> 
           </div> 

           <div class="mod-body">
            <ul> 
            <!-- 判断最新动态 -->
              <!-- 如果回复和发帖都有 -->
            @if(count($cards) && count($replys))
              <!-- 如果发帖早于回复 -->
              @if($cards[0]->time > $cards[0]->time)
             <li> <p> <span class="pull-right text-color-999">{{$cards[0]->time}}</span> <em class="pull-left"><a href="/people/1" class="aw-user-name" data-id="1">{{$user->username}}</a> 发起了帖子,</em> <a class="aw-hide-txt" href="/question/qdetail?id={{$cards[0]->id}}">{{$cards[0]->title}}</a> </p> </li> 
              <!-- 如果回复早于发帖 -->
              @else
              <li> <p> <span class="pull-right text-color-999">{{$replys[0]->rtime}}</span> <em class="pull-left"><div> &nbsp;{{$user->username}}&nbsp; </div> 回答了问题,</em> <a class="aw-hide-txt" href="/question/qdetail?id={{$replys[0]->tid}}">{{$title}}</a> </p> </li> 
              @endif
              <!-- 如果只有发帖 -->
            @elseif(count($cards))
            <li> <p> <span class="pull-right text-color-999">{{$cards[0]->time}}</span> <em class="pull-left"><a href="/people/1" class="aw-user-name" data-id="1">{{$user->username}}</a> 发起了帖子,</em> <a class="aw-hide-txt" href="/question/qdetail?id={{$cards[0]->id}}">{{$cards[0]->title}}</a> </p> </li>
              <!-- 如果只有回复 -->
            @elseif(count($replys))
            <li> <p> <span class="pull-right text-color-999">{{$replys[0]->rtime}}</span> <em class="pull-left"><div> &nbsp;{{$user->username}}&nbsp; </div> 回答了问题,</em> <a class="aw-hide-txt" href="/question/qdetail?id={{$replys[0]->tid}}">{{$title}}</a> </p> </li>
            @else
            <p class="padding10 text-center">没有内容</p>
            @endif

            </ul> 
            

           </div> 
          </div> 
         </div> 
         <div class="tab-pane" id="questions"> 
          <div class="aw-mod"> 
           <div class="mod-head"> 
            <h3>发问</h3> 
           </div> 
           <div class="mod-body"> 
            <div class="aw-profile-publish-list" id="contents_user_actions_questions">
              @if(count($cards))
              @foreach($cards as $k=>$v)
              <div class="aw-item">
                <div class="aw-mod">
                  <div class="mod-head">
                    <h4 class="aw-hide-txt">
                      <a href="/question/qdetail?id={{$v->id}}">{{$v->title}}</a>
                    </h4>
                  </div>
                  <div class="mod-body">
                    <span class="aw-border-radius-5 count pull-left"><i class="icon icon-reply"></i>1</span>
                    <p class="text-color-999">4 次浏览 • 1 个关注 • {{$v->time}}</p>
                  </div>
                </div>
              </div>
              @endforeach
              @else
              <p style="padding: 15px 0" align="center">没有内容</p>
              @endif
            </div> 
           </div> 
           <div class="mod-footer"> 
            <!-- 加载更多内容 --> 
            <a class="aw-load-more-content" id="bp_user_actions_questions_more"> <span>更多</span> </a> 
            <!-- end 加载更多内容 --> 
           </div> 
          </div> 
         </div> 
         <div class="tab-pane" id="answers"> 
          <div class="aw-mod"> 
           <div class="mod-head"> 
            <h3>回复</h3> 
           </div> 
           <div class="mod-body"> 
            <div class="aw-profile-answer-list" id="contents_user_actions_answers">
              @if(count($replys))
              @foreach($replys as $k=>$v)
              <div class="aw-item">
                <div class="aw-mod">
                  <div class="mod-head">
                    <h4 class="aw-hide-txt">
                      <a href="/question/qdetail?id={{$v->tid}}">{{$v->title}}</a>
                    </h4>
                  </div>
                  <div class="mod-body">
                    <span class="aw-border-radius-5 count pull-left"><i class="icon icon-agree"></i>0</span>
                    <p class="text-color-999">{{$v->contents}}</p>
                    <p class="text-color-999">{{$v->rtime}}</p>
                  </div>
                </div>
              </div>
              @endforeach
              @else
              <p style="padding: 15px 0" align="center">没有内容</p>
              @endif

            </div> 
           </div> 
           <div class="mod-footer"> 
            <!-- 加载更多内容 --> 
            <a class="aw-load-more-content" id="bp_user_actions_answers_more"> <span>更多</span> </a> 
            <!-- end 加载更多内容 --> 
           </div> 
          </div> 
         </div> 
         <div class="tab-pane" id="focus"> 
          <!-- 自定义切换 --> 
          <div class="aw-mod"> 
           <div class="aw-tabs text-center"> 
            <ul> 
             <li class="active"><a>关注的人</a></li> 
             <li><a>关注者</a></li> 
             <li><a>关注的话题</a></li> 
            </ul> 
           </div> 
           <div class="mod-body"> 
            <div class="aw-tab-content"> 
             <div class="aw-mod aw-user-center-follow-mod"> 
              <div class="mod-body"> 
               <ul id="contents_user_follows" class="clearfix"></ul> 
              </div> 
              <div class="mod-footer"> 
               <!-- 加载更多内容 --> 
               <a class="aw-load-more-content" id="bp_user_follows_more"> <span>更多</span> </a> 
               <!-- end 加载更多内容 --> 
              </div> 
             </div> 
             <div class="aw-mod aw-user-center-follow-mod hide"> 
              <div class="mod-body"> 
               <ul class="clearfix" id="contents_user_fans"></ul> 
              </div> 
              <div class="mod-footer"> 
               <!-- 加载更多内容 --> 
               <a class="aw-load-more-content" id="bp_user_fans_more"> <span>更多</span> </a> 
               <!-- end 加载更多内容 --> 
              </div> 
             </div> 
             <div class="aw-mod aw-user-center-follow-mod hide"> 
              <div class="mod-body"> 
               <ul id="contents_user_topics" class="clearfix"></ul> 
              </div> 
              <div class="mod-footer"> 
               <!-- 加载更多内容 --> 
               <a class="aw-load-more-content" id="bp_user_topics_more"> <span>更多</span> </a> 
               <!-- end 加载更多内容 --> 
              </div> 
             </div> 
            </div> 
           </div> 
          </div> 
          <!-- end 自定义切换 --> 
         </div> 
         <div class="tab-pane" id="actions"> 
          <div class="aw-mod"> 
           <div class="mod-head"> 
            <h3>最新动态</h3> 
           </div> 
           <div class="mod-body"> 
            <div id="contents_user_actions"></div> 
           </div> 
           <div class="mod-footer"> 
            <!-- 加载更多内容 --> 
            <a class="aw-load-more-content" id="bp_user_actions_more"> <span>更多</span> </a> 
            <!-- end 加载更多内容 --> 
           </div> 
          </div> 
         </div> 
        </div> 
       </div> 
      </div> 
      <!-- 侧边栏 --> 
      <div class="col-sm-12 col-md-3 aw-side-bar"> 
       <div class="aw-mod people-following"> 
        <div class="mod-body"> 
         <a onclick="$('#page_focus').click();$('#focus .aw-tabs ul li').eq(0).click();$.scrollTo($('#focus').offset()['top'], 600, {queue:true})" class="pull-right font-size-12">更多 &raquo;</a> 
         <span> 关注 <em class="aw-text-color-blue">1</em> 人 </span> 
         <p> <a class="aw-user-name" data-id="2" href="/people/admin1"><img src="/uploads/avatar/000/00/00/02_avatar_mid.jpg" alt="admin1" /></a> </p> 
        </div> 
       </div> 
       <div class="aw-mod people-following"> 
        <div class="mod-body"> 
         <a onclick="$('#page_focus').click();$('#focus .aw-tabs ul li').eq(1).click();$.scrollTo($('#focus').offset()['top'], 600, {queue:true})" class="pull-right font-size-12">更多 &raquo;</a> 
         <span> 被 <em class="aw-text-color-blue">2</em> 人关注 </span> 
         <p> <a class="aw-user-name" data-id="2" href="/people/admin1"><img src="/uploads/avatar/000/00/00/02_avatar_mid.jpg" alt="admin1" /></a> </p> 
        </div> 
       </div> 
       <div class="aw-mod people-following"> 
        <div class="mod-body">
          关注 
         <em class="aw-text-color-blue">2</em> 话题 
        </div> 
       </div> 
       <div class="aw-mod"> 
        <div class="mod-body"> 
         <span class="aw-text-color-666"> 主页访问量 : 11 次访问 </span> 
        </div> 
       </div> 
      </div> 
      <!-- end 侧边栏 --> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script type="text/javascript">
    var PEOPLE_USER_ID = '1';

    var ACTIVITY_ACTIONS = '101,201,105,204,401,406,501,502,503';
</script> 
  <script type="text/javascript" src="/static/js/app/people.js"></script> 
@endsection